<me:UIWS x:Class="WPFExcelReport.TPWS02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                     xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWS.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTConverter  x:Key="not"/> 
        <ucd:Divideby100  x:Key="d100"/> 
        <ucd:Divideby1000  x:Key="d1000"/> 
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0"> 
           <WrapPanel Background="{StaticResource QueryZoneBrush}">
                    <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" >查询</TextBlock> 
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种:}}"></TextBlock>
                        <ex:AutoTrimTextBox MaxLength="24" Grid.Row="1" CharacterCasing="Upper" 
                                            Text="{Binding ART}" Width="80" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=描述:}}"></TextBlock>
                    <ex:AutoTrimTextBox  Grid.Row="1" CharacterCasing="Upper"  Text="{Binding DES,Converter={StaticResource ResourceKey=gb2312} }" Width="80" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions> 
                    </Grid> 
                </WrapPanel> 
        </StackPanel>
        <Border Grid.Row="1" BorderThickness="2,2,0,0" BorderBrush="{StaticResource BorderBrush}"> 
          <DataGrid    
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible" Grid.ColumnSpan="2" Margin="0,0,0,0"
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=WAART,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=品种}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WAVAR,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=变量}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WABEZ,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=VAABEZ,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WAFBRTU,Converter={StaticResource ResourceKey=d10}}" Header="{Binding Source={Localization:Translate Word=幅宽}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WAFGRQM}" Header="{Binding Source={Localization:Translate Word=克重g/sqm}}"  Width="Auto" /> 
                        <DataGridTextColumn Binding="{Binding Path=WARGRLFD}" Header="{Binding Source={Localization:Translate Word=克重g/m}}"  Width="Auto" /> 
                        <DataGridTextColumn Binding="{Binding Path=WAFFDDIK,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=经密}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WAFFDDIS,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=纬密}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WAFDDIM}" Header="{Binding Source={Localization:Translate Word=单位}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WAAENB,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=更改}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WAAEND,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WANEUB, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=WANEUD,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid  > 
        </Border> 
    </Grid>
</me:UIWS>
